<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weight" data-rule="required" class="form-control form-control" name="row[weigh]" type="number" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Namee')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control form-control" name="row[name]" type="text" value="{$row.name}">
        </div>
    </div>
     <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否必填:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[must_fil]', ['1'=>'是', '2'=>'否'], $row.must_fil)}
        </div>
    </div>  
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
         <div class="col-xs-12 col-sm-8">
            {:build_select('row[type]',$TypeList,$row.type,['class'=>'form-control typechange', 'data-rule'=>'required'])}
        </div>
    </div>    
     <div class="form-group type1" {if $row.type != 1}style="display:none;"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Type 1')}:</label>
          <div class="col-xs-12 col-sm-8">
           <dl class="fieldlist" data-name="row[type1]" data-template="customtpl">
                <dd>
                    <ins>名称</ins>
                    <ins>答案</ins>
                    <ins></ins>
                </dd>
                 {foreach name="$type1" item="vo"}
                    <dd class="form-inline">
                        <input type="text" name="row[type1][{$key+100}][name]" class="form-control type1name"  placeholder="A B C" value="{$vo.name}" > 
                        <input type="text" name="row[type1][{$key+100}][answer]" class="form-control type1answer" value="{$vo.answer}"> 
                        <input {if $vo.status == 2}checked="checked"{/if}name="row[type1][status]" style="width: 30px;" type="radio"  value="{$key+100}">
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> 
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </dd>
                  {/foreach}
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea name="data[type1]" class="form-control hide" cols="30" rows="5"></textarea>
            </dl>
        </div>
    </div>   
    <div class="form-group type2" {if $row.type != 2}style="display:none;"{/if}>
        <label class="control-label col-xs-12 col-sm-2">{:__('Type 2')}:</label>
          <div class="col-xs-12 col-sm-8">
           <dl class="fieldlist" data-name="row[type2]" data-template="customtpl2">
                <dd>
                    <ins>名称</ins>
                    <ins>答案</ins>
                    <ins></ins>
                </dd>
                 {foreach name="$type2" item="vo"}
                    <dd class="form-inline">
                        <input type="text" name="row[type2][{$key+100}][name]" class="form-control type1name"  placeholder="A B C" value="{$vo.name}" > 
                        <input type="text" name="row[type2][{$key+100}][answer]" class="form-control type1answer" value="{$vo.answer}"> 
                        <input {if $vo.status == 2}checked="checked"{/if}name="row[type2][status][]" style="width: 30px;" type="checkbox"  value="{$key+100}">
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> 
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </dd>
                  {/foreach}
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea name="data[type1]" class="form-control hide" cols="30" rows="5"></textarea>
            </dl>
        </div>
    </div>  
    <div class="form-group type3" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type 3')}:</label>
        <div class="col-xs-12 col-sm-8">
           <!--  {:build_select('row[type]',$TypeList,1,['class'=>'form-control', 'data-rule'=>'required'])} -->
        </div>
    </div>

    <input type="hidden"  name="row[z_publish]" value="50">
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script type="text/html" id="customtpl">
    <dd class="form-inline">
        
        <input type="text" name="row[type1][<%=index%>][name]" class="form-control type1name"  placeholder="A B C" value="<%=row.value%>" > 
        <input type="text" name="row[type1][<%=index%>][answer]" class="form-control type1answer" value="<%=row.value%>"> 
        <input   name="row[type1][status]" type="radio"  value="<%=index%>" style="width: 30px;">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> 
        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>
<script type="text/html" id="customtpl2">
    <dd class="form-inline">
        
        <input type="text" name="row[type2][<%=index%>][name]" class="form-control type2name"  placeholder="A B C" value="<%=row.value%>" > 
        <input type="text" name="row[type2][<%=index%>][answer]" class="form-control type2answer" value="<%=row.value%>"> 
        <input   name="row[type2][status][]" type="checkbox"  value="<%=index%>" style="width: 30px;">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> 
        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>